GOptionContext *context;
gboolean ret = FALSE;
gboolean skip_commit = FALSE;
- gboolean in_transaction = FALSE;
gs_unref_object GFile *arg = NULL;
gs_free char *parent = NULL;
gs_free char *commit_checksum = NULL;
if (!ostree_repo_prepare_transaction (repo, opt_link_checkout_speedup, NULL, cancellable, error))
goto out;
- in_transaction = TRUE;
-
mtree = ostree_mutable_tree_new ();
if (argc <= 1 && (opt_trees == NULL || opt_trees[0] == NULL))
if (!ostree_repo_commit_transaction (repo, &stats, cancellable, error))
goto out;
-
- in_transaction = FALSE;
if (!ostree_repo_write_ref (repo, NULL, opt_branch, commit_checksum, error))
goto out;
-
}
else
{
- if (!ostree_repo_abort_transaction (repo, cancellable, error))
- goto out;
-
- in_transaction = FALSE;
-
commit_checksum = g_strdup (parent);
}
ret = TRUE;
out:
- if (in_transaction)
- {
- (void) ostree_repo_abort_transaction (repo, cancellable, NULL);
- }
+ ostree_repo_abort_transaction (repo, cancellable, NULL);
if (context)
g_option_context_free (context);
if (modifier)